﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Manage_Modle_Recruitment_SecrSec : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        CompetenceLib CL = new CompetenceLib();
        CL.IsLogin();
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        String WhereStr = string.Empty;
        if (txbName.Text != String.Empty) {
            WhereStr = LinkStr(WhereStr, "(Sec_Name like '{|}" + txbName.Text + "{|}')");
        }
        if (txbIdentity.Text != String.Empty) {
            WhereStr = LinkStr(WhereStr, "(Sec_Identity like '{|}" + txbIdentity.Text + "{|}')");
        }
        if (txbWord.Text != String.Empty)
        {
            WhereStr = LinkStr(WhereStr, "(Sec_Word like '{|}" + txbWord.Text + "{|}')");
        }
        if (txbWantToWork.Text != String.Empty)
        {
            WhereStr = LinkStr(WhereStr, "(Sec_WantToWork like '{|}" + txbWantToWork.Text + "{|}')");
        }
        if (txbTel.Text != String.Empty)
        {
            WhereStr = LinkStr(WhereStr, "(Sec_Tel like '{|}" + txbTel.Text + "{|}')");
        }
        if (txbEducational.Text != String.Empty)
        {
            WhereStr = LinkStr(WhereStr, "(Sec_Educational like '{|}" + txbEducational.Text + "{|}')");
        }
        if (txbStaTime.Text != String.Empty && txbEndTime.Text != String.Empty)
        {
            WhereStr = LinkStr(WhereStr, "(Sec_CertTime > '" + txbStaTime.Text + "' and Sec_CertTime <'" + txbEndTime.Text + "')");
        }
        if (WhereStr != String.Empty)
        {
            Response.Redirect("SecrList.aspx?Key=" + WhereStr);
        }
        else {
            SetErrorMsg("请填写您的查询条件，查询条件至少要填写一项！");
        }
    }
    public String LinkStr(String OldStr, String NewStr) {
        if (OldStr == String.Empty)
        {
            return NewStr;
        }
        else {
            return OldStr + " Or " + NewStr;
        }
    }
    protected void SetErrorMsg(String Msg)
    {
        Mesg.Text = "<div id=\"msgCard\"><div class=\"error\"><div class=\"error-content\">" + Msg + "</div></div></div>";
    }
}
